#include "crypto/aes_cipher_stream.h"

#include <string>
using std::string;
using std::cout;

int main(int argc, char* argv[])
{
	string password("password"); // Set a static password
	unsigned int blockSize = 1;  // This is the number of bytes to get from the AES stream

	// Create an AES stream with the given password
	CAESCipherStream aesStream(&password);
	string *pStream = new string();

	// Let's get <blockSize> bytes 10 times to see whether the stream works
	for (int i=0; i<10; i++)
	{
		// Gets the next <blockSize> bytes from the previously created AES cipher stream
		aesStream.getNext(pStream, blockSize);
		// Hex output of the AES stream data
		cout << "Number " << i << ": " << CAESCipherStream::hexEncode((byte *)pStream->data(), pStream->length()) << endl;

		// Delete the string and create a new one
		delete pStream;
		pStream = new string();
	}

	// Delete the string
	delete pStream;
	return 0;
}
